<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function show() {
      let pro = new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('成功')//resolve和reject 都是Function类型的参数 这里其实就是对resolve函数传入字符串类型参数'成功'
          console.log(resolve);
          // reject('失败')
        }, 3000);
      })
      console.log(pro);
      return pro
    }
    show().then(suc => console.log(suc), err => console.log(err))
  </script>
</body>

</html>